1. Field of Invention
The present invention relates to a snapshot mechanism of a data processing system and the method and apparatus thereof. More particularly, the present invention relates to a snapshot mechanism of a data processing system and the method and apparatus thereof, which can reduce access time and storage space.
2. Description of Related Art
Data security is the essential requirement of data backup technology, and the original data is expected to be restored in case of physical damage of the storage hardware or data update error (including human error, software error, virus, or invasion of hacker). Thus, the storage process of creating only data mirror cannot resolve the problem completely; instead, the concept of version control has to be adopted in storage technology to restore the history data as expected by the user. The function of snapshot can achieve this requirement. The service is not terminated while performing snapshot function, thus the quality of service provided by the company can be improved, in addition, the backup window can be adjusted flexibly so as to perform snapshot processes in different frequencies according to different significances.
Copy-on-Write (referred to as “CoW” therein after) is the mainstream in snapshot executing methods because of its excellent flexibility and scalability (which means it can be applied to different systems). In consideration of the dependency of file system, snapshot is executed at block level, so that it can be applied to a broader range.
Regarding CoW technology, a manufacturer Redhat provides a snapshot technology which supports one-to-one snapshot as shown in FIG. 1. In this snapshot technology, every time a snapshot volume is set up for a logical volume. Each snapshot volume needs to reserve a space for storing the history data. It is checked that whether the original data in a chunk to be overwritten needs to be stored into the snapshot volume as history data whenever a writing operation is performed to the original logical volume. If not, the original data is copied to the snapshot volume to be kept for later data recovery. As shown in FIG. 1, if the snapshot function is to be performed at different time to the target volume 110, i.e. a particular logical volume, different snapshot volumes have to be set up, for example, the space reserved by the snapshot volume 120 in FIG. 1 is used for storing the history data at 10:00AM, and the reserved spaces of the other snapshot volumes 130, 140, and 150 are respectively used for storing the history data at 12:00AM, 2:00PM, and 4:00PM, and the snapshot process is performed along the time.
However, if the reserved space is not enough for storing the history data, then the snapshot volume is considered invalid and the data cannot be recovered later based on the snapshot volume. Thus, generally speaking, each snapshot volume has to be reserved with enough space in the snapshot technology provided by Redhat Company. The more snapshot volumes are set up for a logical volume, the more snapshot volumes the same history data has to be stored. In the snapshot technology provided by Redhat Company, regarding data recovery, the user can read the history data when she/he is connected to the snapshot volume, but the logical volume is not recovered to the original status when the snapshot volume was set up. However, it is convenient in the management of snapshot volumes because the deletion or updating to a particular snapshot volume will not affect the other snapshot volumes.
In addition, a snapshot technology is provided in the U.S. Pat. No. 6,594,744 with the title of “Managing a snapshot volume or one or more checkpoint volumes with multiple point-in-time images in a single repository” disclosed on 15th, Jul. 2003 by LSI Logic Corporation. As shown in FIG. 2, each snapshot to a target volume is considered a partition, and all the partitions to the same target volume are integrated into a large snapshot volume. For example, each snapshot of the target volume 210 is stored into the snapshot volume 220 in sequence, for example, snapshots A, B, C, and D are respectively stored into the partitions A, B, C, and D of the same snapshot volume 220. Compared with the snapshot technology provided by Redhat Company, wherein the same history data has to be stored in many snapshots, this technology supports single snapshot volume storing multiple snapshot images.
In conventional snapshot technologies, including the two described above, for the convenience of management, a snapshot volume is generally created for the volume requiring backup for storing history data thereof, which will result in the history data being stored repeatedly and waste in time (coping multiple copies of history data) and space (too much reserved space and the space taken by the multiple copies of history data) since every snapshot volume has to reserve a space.